package webreader;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

public class WebsiteReader
{
	public static BufferedReader read(String url) throws Exception{
		return new BufferedReader(
			new InputStreamReader(
				new URL(url).openStream()));}

	public static void main (String[] args) throws Exception{
		BufferedReader reader = read("http://www.google.it");
		String line = reader.readLine();

		while (line != null) {
			System.out.println(line);
			line = reader.readLine(); }}
}
